<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
    <th:block th:replace="~{layouts/common::layui}"></th:block>
    <th:block th:replace="~{layouts/common::vue}"></th:block>
    <th:block th:replace="~{layouts/common::element}"></th:block>
</head>
<body>
    <div id="app">
        当前时间：{{time}}
    </div>
</body>
<script>
    let { ref, createApp } = Vue;
    const app = createApp({
        setup(){
            const getTime = () => layui.util.toDateString(new Date(), 'yyyy-MM-dd HH:mm:ss');
            const time = ref(getTime());
            setInterval(() => time.value = getTime(), 1000);

            return {
                time
            };
        }
    });
    app.use(ElementPlus);
    app.mount('#app');
</script>
</html>